<!DOCTYPE html>
<html>
<head>
	<title>PHP lessen 2012/2013</title>
	<meta charset="utf-8">
	<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body>
<div class='left'>
<h1>Output van <?php echo basename($_SERVER['PHP_SELF']) ?></h1> 
<p>
<a href="javascript:$('#source').toggleClass('hide')">Toon/verberg sourcecode</a>
</p>
<?php echo $output; ?>
</div>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>

<script>
$(document).ready(function() {
	$('#source').toggleClass('hide');
});
</script>
<pre id='source'>
<?php 
if (!isset($link)) $link="";

$filename = $_SERVER['DOCUMENT_ROOT'].$_SERVER['PHP_SELF']; 
$handle = fopen($filename, "r");
$contents = fread($handle, filesize($filename));
fclose($handle);
echo htmlspecialchars($contents);
?>
</pre>
<p class='clear'>
<?php echo $link ?>
</p>
</body>
</html>